<?php include PATH_TPL."/admin/tpl.header.phtml"?>
<div class="main-container inner">
    <div class="main-content">
        <div class="container-fluid">
            <div class="row bt">
                <div class="col-lg-12 bg">
                    <ol class="breadcrumb">
                        <li class="active">
                        <i class="fa  fa-fw fa-reorder"></i>老人管理
                        </li>
                    </ol>
                </div>
            </div>
            <div class="column">
            <form method="get" action="/admin_senior">
                <div class="text-center"><h4>护工信息</h4></div>
                <!--<span style="margin-left:40px;">老人姓名：</span><input type="text" style="width:80px;height:30px;" name="name" value="<?=$pName?>"/>
                <span style="margin-left:20px;">委托人联系电话：</span><input type="text" style="width:100px;height:30px;" name="phonenumber" />
                <span>入院时间：</span>
                <span style="cursor:pointer;" onclick="WdatePicker({el:'datetime'})" class="dateicon"><span class="glyphicon glyphicon-calendar"></span></span>
                <input type="text" name="created" id="datetime" value="<?=$pCreated?>" onclick="WdatePicker();"/>
                <span style="margin-left:20px;">所在部门：</span>
                <select>
                    <option>不限</option>
                </select>
                <button type="button" class="btn btn-blue" id="search">查询</button>
                <a class="btn btn-blue" href="/admin_senior/add">新增用户</a>-->
            </div>
            <div class="panel-body text-center">
                <table class="table table-hover" id="table_list">
                    <thead>
                        <tr>
                            <td>编号</td>
                            <td>护工姓名</td>
                            <td>已绑定老人数</td>
                            <td>所在部门</td>
                            <td>护理过病人的病例</td>
                            <td>职业技能</td>
                            <td>操作</td>
                        </tr>
                    </thead>
                    <?foreach($tDatas as $tRow){?>
                    <tr>
                        <td><?=$tRow['id']?></td>
                        <td><?=empty($tRow['name'])?'未知姓名':$tRow['name']?></td>
                        <td><?=$tRow['scnt']?></td>
                        <td><?=$getDepartment['department']?></td>
                        <td><?=$tRow['']?></td>
                        <td><?=$getNation[$tRow['nation']]?></td>
                        <td>
                        <a role="menuitem" class="bound btn btn-red btn-xs tooltips demo_4" tabindex="-1" data-original-title="绑定" data-placement="top" data="<?=$tRow['id']?>"> <i class="glyphicon glyphicon-ok"></i></a>
</td>
                    </tr>
                    <?}?>
                </table>
                <?=$tShow?>
            </div>
            </form>
        </div>
        <div class="subviews">
            <div class="subviews-container"></div>
        </div>
    </div>
    <!-- end: PAGE -->
</div>
<!-- end: MAIN CONTAINER -->
<script type="text/javascript" src="/plugins/datepicker/WdatePicker.js" charset="UTF-8"></script>
<script>
$('#search').click(function(){
    $('form').submit();
});
    $('.bound').each(function(){
		$(this).click(function(){
			var sw_id = $(this).attr('data');
            var sid = GetQuery('id');
            $.post('/admin_senior/bound',{sw_id:sw_id,sid:sid},function(obj){
				alert(obj.msg);window.location.href = '/admin_senior';	
			});
		});		
	});
/*获取地址栏参数*/
function GetQuery(key){
	var search = location.search.slice(1);//得到get方式提交的查询字符串
	var arr = search.split("&");
	for(var i = 0; i < arr.length; i++){
		var ar = arr[i].split("=");
		if(ar[0] == key){
			return ar[1];
		}
	}
}
    var color="#eeeeee";
    $("#table_list tr:odd td").css("background-color",color);  //改变偶数行背景色
    /* 把背景色保存到属性中 */
    $("#table_list tr:odd").attr("bg",color);
</script>
<?php include PATH_TPL."/admin/tpl.footer.phtml"?>
